import { create } from 'zustand';
import {
  combine,
  // persist,
  subscribeWithSelector,
} from 'zustand/middleware';

/** store */
export const useTabBarStore = create(
  subscribeWithSelector(
    combine(
      {
        activeIndex: 0,
      },
      (set) => {
        return {
          async setActive(index: number) {
            set((state) => ({ ...state, activeIndex: index }));
          },
          setCurrentPants(val: string | undefined) {
            set((state) => ({ ...state, currentPants: val }));
          },
        };
      },
    )
  ),
);
